<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: aifes_core.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('aifes__core_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">aifes_core.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="aifes__core_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#ifndef AIFES_CORE</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define AIFES_CORE</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="aifes__math_8h.html">aifes_math.h</a>&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;aifes_config.h&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#define TRUE    1</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#define FALSE   0</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#define AILAYER_SETTINGS_TRAINING_MODE                  0</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#define AILAYER_SETTINGS_TRAINABLE                      1</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#define AILAYER_SETTINGS_BATCH_MODE                     2 </span><span class="comment">// When true, a whole batch is processed in a single forward pass</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#define AILAYER_SETTINGS_NO_INPUT_GRADIENT              3 </span><span class="comment">// When true, no input gradient is calculated</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#define AILAYER_SETTINGS_KEEP_INPUT_BUFFER_FOR_RESULT   4 </span><span class="comment">// When true, no input gradient is calculated</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#define AILAYER_SETTINGS_SET(settings, mask, selector, value)   (settings = ((settings) &amp; ~(mask &lt;&lt; (selector))) | ((value) &lt;&lt; (selector)))</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#define AILAYER_SETTINGS_IS(settings, mask, selector)           (((settings) &gt;&gt; (selector)) &amp; mask)</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structailayer.html">ailayer</a>  <a class="code" href="structailayer.html">ailayer_t</a>;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structailoss.html">ailoss</a>   <a class="code" href="structailoss.html">ailoss_t</a>;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structaimodel.html">aimodel</a>  <a class="code" href="structaimodel.html">aimodel_t</a>;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structaiopti.html">aiopti</a>   <a class="code" href="structaiopti.html">aiopti_t</a>;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structaicore__layertype.html">aicore_layertype</a> <a class="code" href="structaicore__layertype.html">aicore_layertype_t</a>;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structaicore__losstype.html">aicore_losstype</a> <a class="code" href="structaicore__losstype.html">aicore_losstype_t</a>;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structaicore__optitype.html">aicore_optitype</a> <a class="code" href="structaicore__optitype.html">aicore_optitype_t</a>;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160; </div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="structaicore__layertype.html">   82</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structaicore__layertype.html">aicore_layertype</a> {</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="structaicore__layertype.html#a8f8f80d37794cde9472343e4487ba3eb">   83</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structaicore__layertype.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>; </div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="structaicore__layertype.html#a00bc72ab6d23f7ad53b92a8c64484b18">   92</a></span>&#160;    void (*<a class="code" href="structaicore__layertype.html#a00bc72ab6d23f7ad53b92a8c64484b18">print_specs</a>)(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;};</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="structaicore__losstype.html">  121</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structaicore__losstype.html">aicore_losstype</a> {</div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="structaicore__losstype.html#a8f8f80d37794cde9472343e4487ba3eb">  122</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structaicore__losstype.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>; </div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="structaicore__losstype.html#a7ea4e2b11ece1dd4870f0fb364c15253">  131</a></span>&#160;    void (*<a class="code" href="structaicore__losstype.html#a7ea4e2b11ece1dd4870f0fb364c15253">print_specs</a>)(<span class="keyword">const</span> <a class="code" href="structailoss.html">ailoss_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;};</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160; </div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="structaicore__optitype.html">  160</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structaicore__optitype.html">aicore_optitype</a> {</div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="structaicore__optitype.html#a8f8f80d37794cde9472343e4487ba3eb">  161</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structaicore__optitype.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>; </div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="structaicore__optitype.html#a6c47b929d158f7ef286d7faef130e018">  170</a></span>&#160;    void (*<a class="code" href="structaicore__optitype.html#a6c47b929d158f7ef286d7faef130e018">print_specs</a>)(<span class="keyword">const</span> <a class="code" href="structaiopti.html">aiopti_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;};</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160; </div>
<div class="line"><a name="l00181"></a><span class="lineno"><a class="line" href="structaimodel.html">  181</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structaimodel.html">aimodel</a> {</div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="structaimodel.html#a708a94e69112ad215b2b52da2238a711">  182</a></span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> *<a class="code" href="structaimodel.html#a708a94e69112ad215b2b52da2238a711">input_layer</a>; </div>
<div class="line"><a name="l00183"></a><span class="lineno"><a class="line" href="structaimodel.html#a7c7ad89e7d15631b3f5893b8f19030ef">  183</a></span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> *<a class="code" href="structaimodel.html#a7c7ad89e7d15631b3f5893b8f19030ef">output_layer</a>; </div>
<div class="line"><a name="l00185"></a><span class="lineno"><a class="line" href="structaimodel.html#a43c06bad78e81f2596a256d6455dfbdf">  185</a></span>&#160;    uint16_t <a class="code" href="structaimodel.html#a43c06bad78e81f2596a256d6455dfbdf">layer_count</a>; </div>
<div class="line"><a name="l00186"></a><span class="lineno"><a class="line" href="structaimodel.html#a0ccfc06a73c9325540dea85791a1e36b">  186</a></span>&#160;    uint16_t <a class="code" href="structaimodel.html#a0ccfc06a73c9325540dea85791a1e36b">trainable_params_count</a>; </div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="structaimodel.html#ad08c61cef46d4042c62d8cdeba81986f">  188</a></span>&#160;    <a class="code" href="structailoss.html">ailoss_t</a> *<a class="code" href="structaimodel.html#ad08c61cef46d4042c62d8cdeba81986f">loss</a>; </div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;};</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160; </div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160; </div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="structailayer.html">  252</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structailayer.html">ailayer</a> {</div>
<div class="line"><a name="l00253"></a><span class="lineno"><a class="line" href="structailayer.html#a259a8d38509bfc89f5ff49b2a0d26b92">  253</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="structaicore__layertype.html">aicore_layertype_t</a> *<a class="code" href="structailayer.html#a259a8d38509bfc89f5ff49b2a0d26b92">layer_type</a>; </div>
<div class="line"><a name="l00254"></a><span class="lineno"><a class="line" href="structailayer.html#a27d1eadee2654a2bd6e740eff4004ba8">  254</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structailayer.html#a27d1eadee2654a2bd6e740eff4004ba8">layer_configuration</a>; </div>
<div class="line"><a name="l00271"></a><span class="lineno"><a class="line" href="structailayer.html#ac0da37622121ce424bfefdeaaf924508">  271</a></span>&#160;    uint32_t <a class="code" href="structailayer.html#ac0da37622121ce424bfefdeaaf924508">settings</a>; </div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> *input_layer;</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <span class="comment">//ailayer_t *brother_input_layer; /**&lt; (NOT_IN_USE) Chained list if multiple input layer are present else NULL. */</span></div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160; </div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> *output_layer;</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    <span class="comment">//ailayer_t *brother_output_layer; /**&lt; (NOT_IN_USE) Chained list if multiple output layer are present else NULL. */</span></div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> *next_scheduled;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> *prev_scheduled;</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160; </div>
<div class="line"><a name="l00292"></a><span class="lineno"><a class="line" href="structailayer.html#a1ed86d1fec7aae68bc79c55f3f965790">  292</a></span>&#160;    <a class="code" href="structaitensor.html">aitensor_t</a> <a class="code" href="structailayer.html#a1ed86d1fec7aae68bc79c55f3f965790">result</a>; </div>
<div class="line"><a name="l00300"></a><span class="lineno"><a class="line" href="structailayer.html#a66787e37cfd371070476221e86386f7c">  300</a></span>&#160;    void (*<a class="code" href="structailayer.html#a66787e37cfd371070476221e86386f7c">calc_result_shape</a>)(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160; </div>
<div class="line"><a name="l00309"></a><span class="lineno"><a class="line" href="structailayer.html#ab5e8fd65efe85a1ee1ac9147594ddd61">  309</a></span>&#160;    void (*<a class="code" href="structailayer.html#ab5e8fd65efe85a1ee1ac9147594ddd61">calc_result_tensor_params</a>)(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160; </div>
<div class="line"><a name="l00315"></a><span class="lineno"><a class="line" href="structailayer.html#a5fbd0ec6a416b01399233d98e60ca060">  315</a></span>&#160;    void (*<a class="code" href="structailayer.html#a5fbd0ec6a416b01399233d98e60ca060">forward</a>)(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160; </div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    <span class="comment">// Maybe for later purpose</span></div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    <span class="comment">//void (*sizeof_infmem)(struct aifes_layer_t *, void *);</span></div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;    <span class="comment">//void (*set_infmem)(struct aifes_layer_t *, void *);</span></div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160; </div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    <span class="comment">// ------------------ Used for training only: -----------------------</span></div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160; </div>
<div class="line"><a name="l00323"></a><span class="lineno"><a class="line" href="structailayer.html#a6e0cd193754d9614d5da823f0f0fcbf6">  323</a></span>&#160;    <a class="code" href="structaitensor.html">aitensor_t</a> <a class="code" href="structailayer.html#a6e0cd193754d9614d5da823f0f0fcbf6">deltas</a>; </div>
<div class="line"><a name="l00331"></a><span class="lineno"><a class="line" href="structailayer.html#a328cb32bcb611f02ace7da86ab9711a2">  331</a></span>&#160;    uint8_t <a class="code" href="structailayer.html#a328cb32bcb611f02ace7da86ab9711a2">trainable_params_count</a>; </div>
<div class="line"><a name="l00332"></a><span class="lineno"><a class="line" href="structailayer.html#a8a3410d74de23e53ffb75649fec0851a">  332</a></span>&#160;    <a class="code" href="structaitensor.html">aitensor_t</a> **<a class="code" href="structailayer.html#a8a3410d74de23e53ffb75649fec0851a">trainable_params</a>; </div>
<div class="line"><a name="l00333"></a><span class="lineno"><a class="line" href="structailayer.html#adf565818ce1d94c39e818326a25a6de8">  333</a></span>&#160;    <a class="code" href="structaitensor.html">aitensor_t</a> **<a class="code" href="structailayer.html#adf565818ce1d94c39e818326a25a6de8">gradients</a>; </div>
<div class="line"><a name="l00334"></a><span class="lineno"><a class="line" href="structailayer.html#a0d7d5229bb3c514d7bd3e2bcf40c5f5a">  334</a></span>&#160;    <span class="keywordtype">void</span> **<a class="code" href="structailayer.html#a0d7d5229bb3c514d7bd3e2bcf40c5f5a">optimem</a>; </div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160; </div>
<div class="line"><a name="l00341"></a><span class="lineno"><a class="line" href="structailayer.html#a235e06f76bc9641b9c9b95ae29b56fe9">  341</a></span>&#160;    void (*<a class="code" href="structailayer.html#a235e06f76bc9641b9c9b95ae29b56fe9">backward</a>)(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160; </div>
<div class="line"><a name="l00351"></a><span class="lineno"><a class="line" href="structailayer.html#ab758b2be3966c7cc0bf6920a60886bbf">  351</a></span>&#160;    uint32_t (*<a class="code" href="structailayer.html#ab758b2be3966c7cc0bf6920a60886bbf">sizeof_paramem</a>)(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>); </div>
<div class="line"><a name="l00352"></a><span class="lineno"><a class="line" href="structailayer.html#a219921bd3b75e98894a33f6c2ff61c07">  352</a></span>&#160;    void (*<a class="code" href="structailayer.html#a219921bd3b75e98894a33f6c2ff61c07">set_paramem</a>)(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>, <span class="keywordtype">void</span>* memory_ptr); </div>
<div class="line"><a name="l00353"></a><span class="lineno"><a class="line" href="structailayer.html#aedac95cb35a037d0e513ac690c34681a">  353</a></span>&#160;    void (*<a class="code" href="structailayer.html#aedac95cb35a037d0e513ac690c34681a">init_params</a>)(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>); </div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160; </div>
<div class="line"><a name="l00360"></a><span class="lineno"><a class="line" href="structailayer.html#adad0c59ab4a340940e6eb6a57f702b42">  360</a></span>&#160;    uint32_t (*<a class="code" href="structailayer.html#adad0c59ab4a340940e6eb6a57f702b42">sizeof_fwdmem</a>)(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>); </div>
<div class="line"><a name="l00361"></a><span class="lineno"><a class="line" href="structailayer.html#aa82f1f4092a60d30090d4e519b02d98d">  361</a></span>&#160;    uint32_t (*<a class="code" href="structailayer.html#aa82f1f4092a60d30090d4e519b02d98d">sizeof_bwdmem</a>)(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>); </div>
<div class="line"><a name="l00362"></a><span class="lineno"><a class="line" href="structailayer.html#a5b6e01700671b0cb2118edd432b09a76">  362</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structailayer.html#a5b6e01700671b0cb2118edd432b09a76">tempmem</a>; </div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160; </div>
<div class="line"><a name="l00372"></a><span class="lineno"><a class="line" href="structailayer.html#af95ecd0e925bff73b30b1d1b6fc21028">  372</a></span>&#160;    uint32_t (*<a class="code" href="structailayer.html#af95ecd0e925bff73b30b1d1b6fc21028">sizeof_trainmem</a>)(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>); </div>
<div class="line"><a name="l00373"></a><span class="lineno"><a class="line" href="structailayer.html#a5062b6bf991a3ae278941c560847eeb6">  373</a></span>&#160;    void (*<a class="code" href="structailayer.html#a5062b6bf991a3ae278941c560847eeb6">set_trainmem</a>)(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>, <span class="keywordtype">void</span>* memory_ptr); </div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;};</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160; </div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160; </div>
<div class="line"><a name="l00385"></a><span class="lineno"><a class="line" href="structailoss.html">  385</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structailoss.html">ailoss</a> {</div>
<div class="line"><a name="l00386"></a><span class="lineno"><a class="line" href="structailoss.html#abf49a46edc25393b8cf2d799861961ea">  386</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="structaicore__losstype.html">aicore_losstype_t</a> *<a class="code" href="structailoss.html#abf49a46edc25393b8cf2d799861961ea">loss_type</a>; </div>
<div class="line"><a name="l00387"></a><span class="lineno"><a class="line" href="structailoss.html#a3121ea3e968d07206c419b358a5cfafc">  387</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structailoss.html#a3121ea3e968d07206c419b358a5cfafc">loss_configuration</a>; </div>
<div class="line"><a name="l00389"></a><span class="lineno"><a class="line" href="structailoss.html#ad7053c8e36973515431688c9efe026ce">  389</a></span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> <a class="code" href="structailoss.html#ad7053c8e36973515431688c9efe026ce">connection_layer</a>; </div>
<div class="line"><a name="l00397"></a><span class="lineno"><a class="line" href="structailoss.html#afb6e75cd4aa201c51f7f220dc15abcb3">  397</a></span>&#160;    void (*<a class="code" href="structailoss.html#afb6e75cd4aa201c51f7f220dc15abcb3">calc_loss</a>)(<a class="code" href="structailoss.html">ailoss_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *target_data, <span class="keywordtype">void</span> *result);</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160; </div>
<div class="line"><a name="l00404"></a><span class="lineno"><a class="line" href="structailoss.html#ae84860a963e24221ba373a1554f20930">  404</a></span>&#160;    void (*<a class="code" href="structailoss.html#ae84860a963e24221ba373a1554f20930">calc_delta</a>)(<a class="code" href="structailoss.html">ailoss_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *target_data);</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;};</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160; </div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160; </div>
<div class="line"><a name="l00438"></a><span class="lineno"><a class="line" href="structaiopti.html">  438</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structaiopti.html">aiopti</a> {</div>
<div class="line"><a name="l00439"></a><span class="lineno"><a class="line" href="structaiopti.html#a6ca0fdd2169bc462e1cc4f87e786933d">  439</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="structaicore__optitype.html">aicore_optitype_t</a> *<a class="code" href="structaiopti.html#a6ca0fdd2169bc462e1cc4f87e786933d">optimizer_type</a>; </div>
<div class="line"><a name="l00440"></a><span class="lineno"><a class="line" href="structaiopti.html#a137684e527116392d2672299bc93b95c">  440</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structaiopti.html#a137684e527116392d2672299bc93b95c">optimizer_configuration</a>; </div>
<div class="line"><a name="l00441"></a><span class="lineno"><a class="line" href="structaiopti.html#abf7a461af7296a09d5246ca13591b988">  441</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="structaimath__dtype.html">aimath_dtype_t</a> *<a class="code" href="structaiopti.html#abf7a461af7296a09d5246ca13591b988">dtype</a>; </div>
<div class="line"><a name="l00443"></a><span class="lineno"><a class="line" href="structaiopti.html#aafeaaeb2f574aee6bb461dac6bc9ddfb">  443</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structaiopti.html#aafeaaeb2f574aee6bb461dac6bc9ddfb">learning_rate</a>; </div>
<div class="line"><a name="l00450"></a><span class="lineno"><a class="line" href="structaiopti.html#a948b4e86692cb9306c71c1099a6ba67d">  450</a></span>&#160;    uint32_t (*<a class="code" href="structaiopti.html#a948b4e86692cb9306c71c1099a6ba67d">sizeof_optimem</a>)(<a class="code" href="structaiopti.html">aiopti_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *params);</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160; </div>
<div class="line"><a name="l00459"></a><span class="lineno"><a class="line" href="structaiopti.html#a39e07b6004587fae3c9b12b1821ef066">  459</a></span>&#160;    void (*<a class="code" href="structaiopti.html#a39e07b6004587fae3c9b12b1821ef066">init_optimem</a>)(<a class="code" href="structaiopti.html">aiopti_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *params, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *gradients, <span class="keywordtype">void</span> *optimem);</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160; </div>
<div class="line"><a name="l00466"></a><span class="lineno"><a class="line" href="structaiopti.html#ae145c9527c45c9c98fe7a0b317245e66">  466</a></span>&#160;    void (*<a class="code" href="structaiopti.html#ae145c9527c45c9c98fe7a0b317245e66">zero_gradients</a>)(<a class="code" href="structaiopti.html">aiopti_t</a> *<span class="keyword">self</span>, <a class="code" href="structaitensor.html">aitensor_t</a> *gradients);</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160; </div>
<div class="line"><a name="l00472"></a><span class="lineno"><a class="line" href="structaiopti.html#a5b82d583ac0602253e07aaea992d4e3f">  472</a></span>&#160;    void (*<a class="code" href="structaiopti.html#a5b82d583ac0602253e07aaea992d4e3f">begin_step</a>)(<a class="code" href="structaiopti.html">aiopti_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160; </div>
<div class="line"><a name="l00481"></a><span class="lineno"><a class="line" href="structaiopti.html#a833b900d14688a649c1037466adf444b">  481</a></span>&#160;    void (*<a class="code" href="structaiopti.html#a833b900d14688a649c1037466adf444b">update_params</a>)(<a class="code" href="structaiopti.html">aiopti_t</a> *<span class="keyword">self</span>, <a class="code" href="structaitensor.html">aitensor_t</a> *params, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *gradients, <span class="keywordtype">void</span> *optimem);</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160; </div>
<div class="line"><a name="l00487"></a><span class="lineno"><a class="line" href="structaiopti.html#ae52778f5409e29c7f25cc4ee9ff66f55">  487</a></span>&#160;    void (*<a class="code" href="structaiopti.html#ae52778f5409e29c7f25cc4ee9ff66f55">end_step</a>)(<a class="code" href="structaiopti.html">aiopti_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;};</div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160; </div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160; </div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// AIFES_CORE</span></div>
<div class="ttc" id="aaifes__math_8h_html"><div class="ttname"><a href="aifes__math_8h.html">aifes_math.h</a></div><div class="ttdoc">AIfES 2 math interface.</div></div>
<div class="ttc" id="astructaicore__layertype_html"><div class="ttname"><a href="structaicore__layertype.html">aicore_layertype</a></div><div class="ttdoc">Type indicator of the layer.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:82</div></div>
<div class="ttc" id="astructaicore__layertype_html_a00bc72ab6d23f7ad53b92a8c64484b18"><div class="ttname"><a href="structaicore__layertype.html#a00bc72ab6d23f7ad53b92a8c64484b18">aicore_layertype::print_specs</a></div><div class="ttdeci">void(* print_specs)(const ailayer_t *self)</div><div class="ttdoc">Set a function to print specs of the layer (for example size, constants)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:92</div></div>
<div class="ttc" id="astructaicore__layertype_html_a8f8f80d37794cde9472343e4487ba3eb"><div class="ttname"><a href="structaicore__layertype.html#a8f8f80d37794cde9472343e4487ba3eb">aicore_layertype::name</a></div><div class="ttdeci">const char * name</div><div class="ttdoc">Name of the layer type (for example &quot;Dense&quot;)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:83</div></div>
<div class="ttc" id="astructaicore__losstype_html"><div class="ttname"><a href="structaicore__losstype.html">aicore_losstype</a></div><div class="ttdoc">Type indicator of the loss to check for the loss type.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:121</div></div>
<div class="ttc" id="astructaicore__losstype_html_a7ea4e2b11ece1dd4870f0fb364c15253"><div class="ttname"><a href="structaicore__losstype.html#a7ea4e2b11ece1dd4870f0fb364c15253">aicore_losstype::print_specs</a></div><div class="ttdeci">void(* print_specs)(const ailoss_t *self)</div><div class="ttdoc">Set a function to print specs of the loss.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:131</div></div>
<div class="ttc" id="astructaicore__losstype_html_a8f8f80d37794cde9472343e4487ba3eb"><div class="ttname"><a href="structaicore__losstype.html#a8f8f80d37794cde9472343e4487ba3eb">aicore_losstype::name</a></div><div class="ttdeci">const char * name</div><div class="ttdoc">Name of the loss type (for example &quot;Mean Squared Error&quot;)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:122</div></div>
<div class="ttc" id="astructaicore__optitype_html"><div class="ttname"><a href="structaicore__optitype.html">aicore_optitype</a></div><div class="ttdoc">Type indicator of the optimizer to check for the optimizer type.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:160</div></div>
<div class="ttc" id="astructaicore__optitype_html_a6c47b929d158f7ef286d7faef130e018"><div class="ttname"><a href="structaicore__optitype.html#a6c47b929d158f7ef286d7faef130e018">aicore_optitype::print_specs</a></div><div class="ttdeci">void(* print_specs)(const aiopti_t *self)</div><div class="ttdoc">Set a function to print specs of the optimizer.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:170</div></div>
<div class="ttc" id="astructaicore__optitype_html_a8f8f80d37794cde9472343e4487ba3eb"><div class="ttname"><a href="structaicore__optitype.html#a8f8f80d37794cde9472343e4487ba3eb">aicore_optitype::name</a></div><div class="ttdeci">const char * name</div><div class="ttdoc">Name of the optimizer type (for example &quot;ADAM&quot;)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:161</div></div>
<div class="ttc" id="astructailayer_html"><div class="ttname"><a href="structailayer.html">ailayer</a></div><div class="ttdoc">AIfES layer interface.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:252</div></div>
<div class="ttc" id="astructailayer_html_a0d7d5229bb3c514d7bd3e2bcf40c5f5a"><div class="ttname"><a href="structailayer.html#a0d7d5229bb3c514d7bd3e2bcf40c5f5a">ailayer::optimem</a></div><div class="ttdeci">void ** optimem</div><div class="ttdoc">Array of memory pointers with length trainable_params_count.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:334</div></div>
<div class="ttc" id="astructailayer_html_a1ed86d1fec7aae68bc79c55f3f965790"><div class="ttname"><a href="structailayer.html#a1ed86d1fec7aae68bc79c55f3f965790">ailayer::result</a></div><div class="ttdeci">aitensor_t result</div><div class="ttdoc">The result of the forward function is stored here.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:292</div></div>
<div class="ttc" id="astructailayer_html_a219921bd3b75e98894a33f6c2ff61c07"><div class="ttname"><a href="structailayer.html#a219921bd3b75e98894a33f6c2ff61c07">ailayer::set_paramem</a></div><div class="ttdeci">void(* set_paramem)(ailayer_t *self, void *memory_ptr)</div><div class="ttdoc">Set and distribute the memory block internally.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:352</div></div>
<div class="ttc" id="astructailayer_html_a235e06f76bc9641b9c9b95ae29b56fe9"><div class="ttname"><a href="structailayer.html#a235e06f76bc9641b9c9b95ae29b56fe9">ailayer::backward</a></div><div class="ttdeci">void(* backward)(ailayer_t *self)</div><div class="ttdoc">Calculate the backward pass and write the result to the deltas tensor.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:341</div></div>
<div class="ttc" id="astructailayer_html_a259a8d38509bfc89f5ff49b2a0d26b92"><div class="ttname"><a href="structailayer.html#a259a8d38509bfc89f5ff49b2a0d26b92">ailayer::layer_type</a></div><div class="ttdeci">const aicore_layertype_t * layer_type</div><div class="ttdoc">Type of the layer (for example ailayer_dense_type)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:253</div></div>
<div class="ttc" id="astructailayer_html_a27d1eadee2654a2bd6e740eff4004ba8"><div class="ttname"><a href="structailayer.html#a27d1eadee2654a2bd6e740eff4004ba8">ailayer::layer_configuration</a></div><div class="ttdeci">void * layer_configuration</div><div class="ttdoc">Layer specific configurations (back-link from abstract layer class to implementation)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:254</div></div>
<div class="ttc" id="astructailayer_html_a328cb32bcb611f02ace7da86ab9711a2"><div class="ttname"><a href="structailayer.html#a328cb32bcb611f02ace7da86ab9711a2">ailayer::trainable_params_count</a></div><div class="ttdeci">uint8_t trainable_params_count</div><div class="ttdoc">Number of trainable parameter tensors.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:331</div></div>
<div class="ttc" id="astructailayer_html_a5062b6bf991a3ae278941c560847eeb6"><div class="ttname"><a href="structailayer.html#a5062b6bf991a3ae278941c560847eeb6">ailayer::set_trainmem</a></div><div class="ttdeci">void(* set_trainmem)(ailayer_t *self, void *memory_ptr)</div><div class="ttdoc">Set and distribute the memory block internally.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:373</div></div>
<div class="ttc" id="astructailayer_html_a5b6e01700671b0cb2118edd432b09a76"><div class="ttname"><a href="structailayer.html#a5b6e01700671b0cb2118edd432b09a76">ailayer::tempmem</a></div><div class="ttdeci">void * tempmem</div><div class="ttdoc">Pointer to the memory for the forward pass, backward pass and the optimizer.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:362</div></div>
<div class="ttc" id="astructailayer_html_a5fbd0ec6a416b01399233d98e60ca060"><div class="ttname"><a href="structailayer.html#a5fbd0ec6a416b01399233d98e60ca060">ailayer::forward</a></div><div class="ttdeci">void(* forward)(ailayer_t *self)</div><div class="ttdoc">Calculate the forward pass and write the result to the result tensor.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:315</div></div>
<div class="ttc" id="astructailayer_html_a66787e37cfd371070476221e86386f7c"><div class="ttname"><a href="structailayer.html#a66787e37cfd371070476221e86386f7c">ailayer::calc_result_shape</a></div><div class="ttdeci">void(* calc_result_shape)(ailayer_t *self)</div><div class="ttdoc">Calculate and write the shape to the result tensor.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:300</div></div>
<div class="ttc" id="astructailayer_html_a6e0cd193754d9614d5da823f0f0fcbf6"><div class="ttname"><a href="structailayer.html#a6e0cd193754d9614d5da823f0f0fcbf6">ailayer::deltas</a></div><div class="ttdeci">aitensor_t deltas</div><div class="ttdoc">The result of the backward function is stored here.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:323</div></div>
<div class="ttc" id="astructailayer_html_a8a3410d74de23e53ffb75649fec0851a"><div class="ttname"><a href="structailayer.html#a8a3410d74de23e53ffb75649fec0851a">ailayer::trainable_params</a></div><div class="ttdeci">aitensor_t ** trainable_params</div><div class="ttdoc">Array of tensor pointers with length trainable_params_count.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:332</div></div>
<div class="ttc" id="astructailayer_html_aa82f1f4092a60d30090d4e519b02d98d"><div class="ttname"><a href="structailayer.html#aa82f1f4092a60d30090d4e519b02d98d">ailayer::sizeof_bwdmem</a></div><div class="ttdeci">uint32_t(* sizeof_bwdmem)(const ailayer_t *self)</div><div class="ttdoc">Size of required memory for the backward pass (in bytes).</div><div class="ttdef"><b>Definition:</b> aifes_core.h:361</div></div>
<div class="ttc" id="astructailayer_html_ab5e8fd65efe85a1ee1ac9147594ddd61"><div class="ttname"><a href="structailayer.html#ab5e8fd65efe85a1ee1ac9147594ddd61">ailayer::calc_result_tensor_params</a></div><div class="ttdeci">void(* calc_result_tensor_params)(ailayer_t *self)</div><div class="ttdoc">If available, calculate and set the tensor_params of the result tensor.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:309</div></div>
<div class="ttc" id="astructailayer_html_ab758b2be3966c7cc0bf6920a60886bbf"><div class="ttname"><a href="structailayer.html#ab758b2be3966c7cc0bf6920a60886bbf">ailayer::sizeof_paramem</a></div><div class="ttdeci">uint32_t(* sizeof_paramem)(const ailayer_t *self)</div><div class="ttdoc">Size of required memory (in bytes).</div><div class="ttdef"><b>Definition:</b> aifes_core.h:351</div></div>
<div class="ttc" id="astructailayer_html_ac0da37622121ce424bfefdeaaf924508"><div class="ttname"><a href="structailayer.html#ac0da37622121ce424bfefdeaaf924508">ailayer::settings</a></div><div class="ttdeci">uint32_t settings</div><div class="ttdoc">General layer settings like freezing weights or switching between training and evaluation mode.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:271</div></div>
<div class="ttc" id="astructailayer_html_adad0c59ab4a340940e6eb6a57f702b42"><div class="ttname"><a href="structailayer.html#adad0c59ab4a340940e6eb6a57f702b42">ailayer::sizeof_fwdmem</a></div><div class="ttdeci">uint32_t(* sizeof_fwdmem)(const ailayer_t *self)</div><div class="ttdoc">Size of required memory for the forward pass (in bytes).</div><div class="ttdef"><b>Definition:</b> aifes_core.h:360</div></div>
<div class="ttc" id="astructailayer_html_adf565818ce1d94c39e818326a25a6de8"><div class="ttname"><a href="structailayer.html#adf565818ce1d94c39e818326a25a6de8">ailayer::gradients</a></div><div class="ttdeci">aitensor_t ** gradients</div><div class="ttdoc">Array of tensor pointers with length trainable_params_count.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:333</div></div>
<div class="ttc" id="astructailayer_html_aedac95cb35a037d0e513ac690c34681a"><div class="ttname"><a href="structailayer.html#aedac95cb35a037d0e513ac690c34681a">ailayer::init_params</a></div><div class="ttdeci">void(* init_params)(ailayer_t *self)</div><div class="ttdoc">Initialize the (trainable and not trainable) parameters of the layer with default initializers.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:353</div></div>
<div class="ttc" id="astructailayer_html_af95ecd0e925bff73b30b1d1b6fc21028"><div class="ttname"><a href="structailayer.html#af95ecd0e925bff73b30b1d1b6fc21028">ailayer::sizeof_trainmem</a></div><div class="ttdeci">uint32_t(* sizeof_trainmem)(const ailayer_t *self)</div><div class="ttdoc">Size of required memory (in bytes).</div><div class="ttdef"><b>Definition:</b> aifes_core.h:372</div></div>
<div class="ttc" id="astructailoss_html"><div class="ttname"><a href="structailoss.html">ailoss</a></div><div class="ttdoc">AIfES loss interface.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:385</div></div>
<div class="ttc" id="astructailoss_html_a3121ea3e968d07206c419b358a5cfafc"><div class="ttname"><a href="structailoss.html#a3121ea3e968d07206c419b358a5cfafc">ailoss::loss_configuration</a></div><div class="ttdeci">void * loss_configuration</div><div class="ttdoc">Loss specific configurations (back-link from abstract loss class to implementation)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:387</div></div>
<div class="ttc" id="astructailoss_html_abf49a46edc25393b8cf2d799861961ea"><div class="ttname"><a href="structailoss.html#abf49a46edc25393b8cf2d799861961ea">ailoss::loss_type</a></div><div class="ttdeci">const aicore_losstype_t * loss_type</div><div class="ttdoc">Type of the loss (for example ailoss_mse_type)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:386</div></div>
<div class="ttc" id="astructailoss_html_ad7053c8e36973515431688c9efe026ce"><div class="ttname"><a href="structailoss.html#ad7053c8e36973515431688c9efe026ce">ailoss::connection_layer</a></div><div class="ttdeci">ailayer_t connection_layer</div><div class="ttdoc">Dummy layer for docking to the layer structure.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:389</div></div>
<div class="ttc" id="astructailoss_html_ae84860a963e24221ba373a1554f20930"><div class="ttname"><a href="structailoss.html#ae84860a963e24221ba373a1554f20930">ailoss::calc_delta</a></div><div class="ttdeci">void(* calc_delta)(ailoss_t *self, const aitensor_t *target_data)</div><div class="ttdoc">Calculate the error on the target data and write it to the deltas tensor of connection layer.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:404</div></div>
<div class="ttc" id="astructailoss_html_afb6e75cd4aa201c51f7f220dc15abcb3"><div class="ttname"><a href="structailoss.html#afb6e75cd4aa201c51f7f220dc15abcb3">ailoss::calc_loss</a></div><div class="ttdeci">void(* calc_loss)(ailoss_t *self, const aitensor_t *target_data, void *result)</div><div class="ttdoc">Calculate the loss / cost for the model on the given targets.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:397</div></div>
<div class="ttc" id="astructaimath__dtype_html"><div class="ttname"><a href="structaimath__dtype.html">aimath_dtype</a></div><div class="ttdoc">Indicator for the used datatype.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:44</div></div>
<div class="ttc" id="astructaimodel_html"><div class="ttname"><a href="structaimodel.html">aimodel</a></div><div class="ttdoc">AIfES artificial neural network model.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:181</div></div>
<div class="ttc" id="astructaimodel_html_a0ccfc06a73c9325540dea85791a1e36b"><div class="ttname"><a href="structaimodel.html#a0ccfc06a73c9325540dea85791a1e36b">aimodel::trainable_params_count</a></div><div class="ttdeci">uint16_t trainable_params_count</div><div class="ttdoc">Total number of trainable parameter tensors.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:186</div></div>
<div class="ttc" id="astructaimodel_html_a43c06bad78e81f2596a256d6455dfbdf"><div class="ttname"><a href="structaimodel.html#a43c06bad78e81f2596a256d6455dfbdf">aimodel::layer_count</a></div><div class="ttdeci">uint16_t layer_count</div><div class="ttdoc">Total number of layers of the model (usually autogenerated).</div><div class="ttdef"><b>Definition:</b> aifes_core.h:185</div></div>
<div class="ttc" id="astructaimodel_html_a708a94e69112ad215b2b52da2238a711"><div class="ttname"><a href="structaimodel.html#a708a94e69112ad215b2b52da2238a711">aimodel::input_layer</a></div><div class="ttdeci">ailayer_t * input_layer</div><div class="ttdoc">Input layer of the model that gets the input data.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:182</div></div>
<div class="ttc" id="astructaimodel_html_a7c7ad89e7d15631b3f5893b8f19030ef"><div class="ttname"><a href="structaimodel.html#a7c7ad89e7d15631b3f5893b8f19030ef">aimodel::output_layer</a></div><div class="ttdeci">ailayer_t * output_layer</div><div class="ttdoc">Output layer of the model.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:183</div></div>
<div class="ttc" id="astructaimodel_html_ad08c61cef46d4042c62d8cdeba81986f"><div class="ttname"><a href="structaimodel.html#ad08c61cef46d4042c62d8cdeba81986f">aimodel::loss</a></div><div class="ttdeci">ailoss_t * loss</div><div class="ttdoc">The loss or cost function of the model (only for training).</div><div class="ttdef"><b>Definition:</b> aifes_core.h:188</div></div>
<div class="ttc" id="astructaiopti_html"><div class="ttname"><a href="structaiopti.html">aiopti</a></div><div class="ttdoc">AIfES optimizer interface.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:438</div></div>
<div class="ttc" id="astructaiopti_html_a137684e527116392d2672299bc93b95c"><div class="ttname"><a href="structaiopti.html#a137684e527116392d2672299bc93b95c">aiopti::optimizer_configuration</a></div><div class="ttdeci">void * optimizer_configuration</div><div class="ttdoc">Optimizer specific configurations (back-link from abstract aiopti class to implementation)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:440</div></div>
<div class="ttc" id="astructaiopti_html_a39e07b6004587fae3c9b12b1821ef066"><div class="ttname"><a href="structaiopti.html#a39e07b6004587fae3c9b12b1821ef066">aiopti::init_optimem</a></div><div class="ttdeci">void(* init_optimem)(aiopti_t *self, const aitensor_t *params, const aitensor_t *gradients, void *optimem)</div><div class="ttdoc">Initialize the optimization memory for a trainable parameter tensor.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:459</div></div>
<div class="ttc" id="astructaiopti_html_a5b82d583ac0602253e07aaea992d4e3f"><div class="ttname"><a href="structaiopti.html#a5b82d583ac0602253e07aaea992d4e3f">aiopti::begin_step</a></div><div class="ttdeci">void(* begin_step)(aiopti_t *self)</div><div class="ttdoc">Called in the beginning of every model optimization step for parameter initialization.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:472</div></div>
<div class="ttc" id="astructaiopti_html_a6ca0fdd2169bc462e1cc4f87e786933d"><div class="ttname"><a href="structaiopti.html#a6ca0fdd2169bc462e1cc4f87e786933d">aiopti::optimizer_type</a></div><div class="ttdeci">const aicore_optitype_t * optimizer_type</div><div class="ttdoc">Type of the optimizer (for example aiopti_sgd_type)</div><div class="ttdef"><b>Definition:</b> aifes_core.h:439</div></div>
<div class="ttc" id="astructaiopti_html_a833b900d14688a649c1037466adf444b"><div class="ttname"><a href="structaiopti.html#a833b900d14688a649c1037466adf444b">aiopti::update_params</a></div><div class="ttdeci">void(* update_params)(aiopti_t *self, aitensor_t *params, const aitensor_t *gradients, void *optimem)</div><div class="ttdoc">Performs an optimization step on the given tensor.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:481</div></div>
<div class="ttc" id="astructaiopti_html_a948b4e86692cb9306c71c1099a6ba67d"><div class="ttname"><a href="structaiopti.html#a948b4e86692cb9306c71c1099a6ba67d">aiopti::sizeof_optimem</a></div><div class="ttdeci">uint32_t(* sizeof_optimem)(aiopti_t *self, const aitensor_t *params)</div><div class="ttdoc">Calculates the optimization memory size for a trainable parameter tensor.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:450</div></div>
<div class="ttc" id="astructaiopti_html_aafeaaeb2f574aee6bb461dac6bc9ddfb"><div class="ttname"><a href="structaiopti.html#aafeaaeb2f574aee6bb461dac6bc9ddfb">aiopti::learning_rate</a></div><div class="ttdeci">void * learning_rate</div><div class="ttdoc">The learning rate configures the training speed.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:443</div></div>
<div class="ttc" id="astructaiopti_html_abf7a461af7296a09d5246ca13591b988"><div class="ttname"><a href="structaiopti.html#abf7a461af7296a09d5246ca13591b988">aiopti::dtype</a></div><div class="ttdeci">const aimath_dtype_t * dtype</div><div class="ttdoc">The data-type of the parameter that the optimizer can optimize and the learning rate.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:441</div></div>
<div class="ttc" id="astructaiopti_html_ae145c9527c45c9c98fe7a0b317245e66"><div class="ttname"><a href="structaiopti.html#ae145c9527c45c9c98fe7a0b317245e66">aiopti::zero_gradients</a></div><div class="ttdeci">void(* zero_gradients)(aiopti_t *self, aitensor_t *gradients)</div><div class="ttdoc">Set the gradient tensor to zero.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:466</div></div>
<div class="ttc" id="astructaiopti_html_ae52778f5409e29c7f25cc4ee9ff66f55"><div class="ttname"><a href="structaiopti.html#ae52778f5409e29c7f25cc4ee9ff66f55">aiopti::end_step</a></div><div class="ttdeci">void(* end_step)(aiopti_t *self)</div><div class="ttdoc">Called in the end of every model optimization step.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:487</div></div>
<div class="ttc" id="astructaitensor_html"><div class="ttname"><a href="structaitensor.html">aitensor</a></div><div class="ttdoc">A tensor in AIfES.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:89</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_3d69f64eaf81436fe2b22361382717e5.html">core</a></li><li class="navelem"><a class="el" href="aifes__core_8h.html">aifes_core.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
